import TimerManager from "../Manager/TimerManager";

const { ccclass, property } = cc._decorator;

@ccclass
export default class GameFunctions {
    static async AwaitTime(_duration) {
        await new Promise(res => TimerManager.Instance.scheduleOnce(res, _duration));
    }

    // [min-max]的随机整数
    public static GetRandomNumber(min, max) {
        parseInt(Math.random() * (max - min + 1) + min, 10);
        return Math.floor(Math.random() * (max - min + 1) + min);
    }
}

/** 调试 */
window["GameFunctions"] = GameFunctions;
